package com.hotel.config;

import com.hotel.controller.TemporaryController;

public class Scheduler {

    public static int time = 60 * 60;

    public void invalidOrders(Integer id){
        while (time > 0) {
            time--;
            try {
                Thread.sleep(1000);
                int mm = time / 60 % 1;
                int ss = time % 60;
                System.out.println("还剩"  + mm + "分钟" + ss + "秒");
                if (mm==00&&ss==00){
                    new TemporaryController().deleteTemporary(id);
                    return;
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
